// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Widgets/SCompoundWidget.h"
#include "SFourList.generated.h"

class SSlider;
class SProgressBar;

namespace Plugin_List
{
	class SCollisionScrollBox_List;
}

USTRUCT(BlueprintType)
struct FFourListInfo
{
	GENERATED_BODY()
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = OneInfo)
	float OneValue;
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = TwoInfo)
	float TwoValue;
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ThreeInfo)
	float ThreeValue;
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = FourInfo)
	float FourValue;
};

class STextBlock_TextStyleLambda_List;
/**
 * 
 */
class LISTLIBRARY_API SFourList : public SCompoundWidget
{
public:
	SLATE_BEGIN_ARGS(SFourList)
	:_Title("")
	,_TitleStrStyle("AlibabaRegular_12_83AAD6FF")
	,_ColorOneInfo("")
	,_ColorTwoInfo("")
	,_ColorThreeInfo("")
	,_ColorFourInfo("")
	{}
	SLATE_ARGUMENT(FString, Title)
	SLATE_ARGUMENT(FString, TitleStrStyle)
	SLATE_ARGUMENT(FString, ColorOneInfo)
	SLATE_ARGUMENT(FString, ColorTwoInfo)
	SLATE_ARGUMENT(FString, ColorThreeInfo)
	SLATE_ARGUMENT(FString, ColorFourInfo)
	SLATE_END_ARGS()

	SFourList();
	/** Constructs this widget with InArgs */
	void Construct(const FArguments& InArgs);
	//更新数据表
	void UpDataList(int width,TMap<FString,FFourListInfo> ListData);
	//自适应宽度数据表
	void AutoWidthList(TMap<FString,FFourListInfo> ListData);
	//固定宽度带进度条的表
	//void FixedWidthList(TMap<FString,float> ListData);
	//更改标题名字
	void UpDataTitleName(const FString InTitleName);
	void UpDataOneInfoName(const FString InOneInfoName);
	void UpDataTwoInfoName(const FString InTwoInfoName);
	void UpDataThreeInfoName(const FString InThreeInfoName);
	void UpDataFourInfoName(const FString InFourInfoName);
	void CleanList();
public:
	//显示标题的字符串
	TSharedPtr<STextBlock_TextStyleLambda_List> TitleText;
	TSharedPtr<STextBlock_TextStyleLambda_List> OneInfo;
	TSharedPtr<STextBlock_TextStyleLambda_List> TwoInfo;
	TSharedPtr<STextBlock_TextStyleLambda_List> ThreeInfo;
	TSharedPtr<STextBlock_TextStyleLambda_List> FourInfo;
	
	TSharedPtr <SProgressBar> ProgressBar;
	TSharedPtr<SSlider> Slider;
	//是表格内容部分
	TSharedPtr<SBox> ListContent;
	TSharedPtr<Plugin_List::SCollisionScrollBox_List> ZhuScroll;
	TSharedPtr<Plugin_List::SCollisionScrollBox_List> TextScroll;
	int BeforeWidth;
};